home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / editor / snmp_0_1.zip / snmp-0.1 / aka / snmp / TypeCounter.java < prev    next >
Text File  |  1997-06-09  |  1KB  |  75 lines

  1. /*
  2. Snmp Library
  3. Copyright (C) 1997 Alex Kowalenko Associates Pty Ltd. All rights reserved.
  4.  
  5. This software maybe be free distributed, any any form, without fee, 
  6. but may not be modified in any way without express permission of 
  7. the directors of Alex Kowalenko Associates Pty Ltd. 
  8.  
  9. Alex Kowalenko Associates Pty Ltd makes no representations or
  10. warranties about the suitabililty of the software, not even the
  11. implied warranty of merchantability or fitness for any particular
  12. purpose.    
  13. */
  14.  
  15. package aka.snmp;
  16.  
  17. /**
  18.  * Representation of SNMP COUNTER type.
  19.  * @see TypeInt
  20.  * @see Type
  21.  * @version     $Id: TypeCounter.java,v 1.3 1997/05/18 08:11:54 alex Exp $
  22.  * @author      Alex Kowalenko
  23.  */
  24.  
  25. public class TypeCounter extends TypeInt {
  26.  
  27.     static byte asnValue = ASN.COUNTER;
  28.     static String name = "Counter";
  29.  
  30. /**
  31.  * Constructor
  32.  */
  33.     
  34.     TypeCounter() {
  35.     super();
  36.     }
  37.  
  38. /**
  39.  * Constructor from integer
  40.  */
  41.  
  42.     TypeCounter(int value) {
  43.     super(value);
  44.     }
  45.  
  46. /**
  47.  * Constructor from ByteBuffer
  48.  */
  49.  
  50.     TypeCounter(ByteBuffer buffer) {
  51.     super(buffer);
  52.     };
  53.  
  54. /**
  55.  * returns name of Type
  56.  */
  57.  
  58.     String typeName() {
  59.     return name;
  60.     };
  61.   
  62. /**
  63.  * SNMP protocol conversion.  Convert the variable to a sequence of 
  64.  * bytes, according to SNMP Protocol rules.
  65.  */
  66.  
  67.     public ByteBuffer BERSerialize() {
  68.     ByteBuffer buffer = super.BERSerialize();
  69.     if(buffer.size() > 0)
  70.         buffer.setByteAt(0, asnValue);
  71.     return buffer;
  72.     };
  73.  
  74. };
  75.